<script type="text/javascript">

    function on_submit(){

        $("#rule_form").submit();
    }
    function selShow(){
        var post_time = $("#post_time").val();
        if(post_time == -1){
            $("#set_post_time").show();
        }else{
            $("#set_post_time").hide();
        }
    }
    $("#add_rules").on("hidden.bs.modal", function() {
        $(this).removeData("bs.modal");
    });
</script>

<div class="tab-pane active" id="horizontal-form">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true" aria-label="Close">×</button>
        <h2 class="modal-title">添加话题推荐</h2>
    </div>
    <form class="form-horizontal" name="form" id="rule_form" action="index.php?c=<?php echo $_REQUEST["c"]?>&m=<?php echo $_REQUEST["m"]?>" method="post">
        <input type="hidden" name="submits" value="1"/>

        <div class="form-group">
            <label for="post_times" class="col-sm-2 control-label">话题</label>
            <div class="col-sm-6">
                <div class="input-group suggests" style="margin-left:0px;width: 100%;">
                    <input type="text" placeholder="请输入话题" class="input-sm form-control" id="s_topic_name" value="" onkeyup="getTopicList()" autocomplete="off"/>
                    <input type="hidden" id="s_topic_id" name="s_topic_id" value="">
                    <ul class="dropdown-menu dropdown-menu-right" id="topic_menu"></ul>
                </div>
            </div>
            <div class="col-sm-2">
            </div>
        </div>
        <div class="form-group">
            <label for="post_times" class="col-sm-2 control-label">排序</label>
            <div class="col-sm-6">
                <input type="text" name="sort" class="form-control"  value="<?php echo $topic['sort'];?>">
            </div>
            <div class="col-sm-2">
            </div>
        </div>

        <div class="modal-footer">
            <button type="reset" class="btn btn-default" data-dismiss="modal">关闭</button>
            <button type="button" onclick="on_submit()" class="btn btn-primary">保存</button>
        </div>

    </form>
</div>